﻿#ifndef __INC_QG_IMG_H__
#define __INC_QG_IMG_H__

#ifdef _MSC_VER
#pragma once
#endif

namespace _img
{
	// 읽기
	extern qbFsReader* CreateReaderImageBmp();
	extern qbFsReader* CreateReaderImagePng();
	extern qbFsReader* CreateReaderImageJpg();

	// 읽기 등록
	inline void RegisterReaders(qgStub* stub)
	{
#ifndef QG_NO_BMP
		stub->RegisterReader(QGFSCL_1, CreateReaderImageBmp());
#endif
#ifndef QG_NO_PNG
		stub->RegisterReader(QGFSCL_1, CreateReaderImagePng());
#endif
#ifndef QG_NO_JPG
		stub->RegisterReader(QGFSCL_1, CreateReaderImageJpg());
#endif
	}

	// 쓰기
	extern qbFsWriter* CreateWriterImageBmp();
	extern qbFsWriter* CreateWriterImagePng();
	extern qbFsWriter* CreateWriterImageTga();
	extern qbFsWriter* CreateWriterImageJpg();

	// 쓰기 등록
	inline void RegisterWriters(qgStub* stub)
	{
#ifndef QG_NO_BMP
		stub->RegisterWriter(QGFSCL_1, CreateWriterImageBmp());
#endif
#ifndef QG_NO_PNG
		stub->RegisterWriter(QGFSCL_1, CreateWriterImagePng());
#endif
#ifndef QG_NO_TGA
		stub->RegisterWriter(QGFSCL_1, CreateWriterImageTga());
#endif
#ifndef QG_NO_JPG
		stub->RegisterWriter(QGFSCL_1, CreateWriterImageJpg());
#endif
	}
}

#endif	// __INC_QG_IMG_H__
